package com.youlai.boot.system.model.entity;

import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.KeyType;
import com.mybatisflex.annotation.Table;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.time.LocalDateTime;
import java.util.Date;

/**
 * 用户通知公告实体对象
 *
 * @author youlaitech
 * @since 2024-08-28 16:56
 */
@Getter
@Setter
@Accessors(chain = true)
@Table(value = "sys_user_notice")
public class SysUserNoticeEntity {
    /**
     * 主键ID
     */
    @Id(keyType = KeyType.Auto)
    private Long id;

    /**
     * 公共通知id
     */
    @Column(value = "notice_id")
    private Long noticeId;

    /**
     * 用户id
     */
    @Column(value = "user_id")
    private Long userId;

    /**
     * 读取状态，0未读，1已读
     */
    @Column(value = "is_read")
    private Integer isRead;

    /**
     * 用户阅读时间
     */
    @Column(value = "read_time")
    private LocalDateTime readTime;

    /**
     * 逻辑删除
     */
    @Column(value = "is_deleted", isLogicDelete = true)
    private Integer isDeleted;

    /**
     * 创建时间
     */
    @Column(value = "create_time", onInsertValue = "now()")
    private Date createTime;

    /**
     * 更新时间
     */
    @Column(value = "update_time", onInsertValue = "now()", onUpdateValue = "now()")
    private Date updateTime;

}
